<template>
    <div>
        名字：{{name}}, {{salary}}
        <p>
            <button @click="double">double</button>
        </p>
    </div>
</template>
<script>
import { reactive, toRefs } from 'vue'
export default {
    setup () {
        const stu = reactive(
            {
                name:'小花',
                salary: 12000 
            }
        )
        const double = () => {
            // reactive定义的数据，不要.value
            stu.salary *= 2
        }

        // return { stu, double }
        return { ...toRefs(stu), double }

        // const obj = toRefs(stu)
        // const  { name, salary}  = obj
        // return { name, salary, double }
    }
}
</script>